<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function getSecondsToTomorrow() {
        const d1 = new Date();
        const d2 = new Date();
        d2.setDate(d2.getDate() + 1);
        d2.setHours(0, 0, 0);
        return (d2 - d1) / 1000;
      }
      console.log(getSecondsToTomorrow());
    </script>
  </body>
</html>
